Optimal. Leaf size=73 \[ -\frac {b \left (a^2+b^2\right ) \log (a+b \cot (x))}{a^4}-\frac {b \left (a^2+b^2\right ) \log (\tan (x))}{a^4}+\frac {\left (a^2+b^2\right ) \tan (x)}{a^3}-\frac {b \tan ^2(x)}{2 a^2}+\frac {\tan ^3(x)}{3 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3597, 908}
\begin {gather*} -\frac {b \tan ^2(x)}{2 a^2}-\frac {b \left (a^2+b^2\right ) \log (\tan (x))}{a^4}-\frac {b \left (a^2+b^2\right ) \log (a+b \cot (x))}{a^4}+\frac {\left (a^2+b^2\right ) \tan (x)}{a^3}+\frac {\tan ^3(x)}{3 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 908
Rule 3597
Rubi steps
\begin {align*} \int \frac {\sec ^4(x)}{a+b \cot (x)} \, dx &=-\left (b \text {Subst}\left (\int \frac {b^2+x^2}{x^4 (a+x)} \, dx,x,b \cot (x)\right )\right )\\ &=-\left (b \text {Subst}\left (\int \left (\frac {b^2}{a x^4}-\frac {b^2}{a^2 x^3}+\frac {a^2+b^2}{a^3 x^2}+\frac {-a^2-b^2}{a^4 x}+\frac {a^2+b^2}{a^4 (a+x)}\right ) \, dx,x,b \cot (x)\right )\right )\\ &=-\frac {b \left (a^2+b^2\right ) \log (a+b \cot (x))}{a^4}-\frac {b \left (a^2+b^2\right ) \log (\tan (x))}{a^4}+\frac {\left (a^2+b^2\right ) \tan (x)}{a^3}-\frac {b \tan ^2(x)}{2 a^2}+\frac {\tan ^3(x)}{3 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.30, size = 66, normalized size = 0.90 \begin {gather*} \frac {6 b \left (a^2+b^2\right ) (\log (\cos (x))-\log (b \cos (x)+a \sin (x)))+\left (4 a^3+6 a b^2\right ) \tan (x)+a^2 \sec ^2(x) (-3 b+2 a \tan (x))}{6 a^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.37, size = 56, normalized size = 0.77
method | result | size |
default | \(\frac {\frac {\left (\tan ^{3}\left (x \right )\right ) a^{2}}{3}-\frac {b \left (\tan ^{2}\left (x \right )\right ) a}{2}+a^{2} \tan \left (x \right )+b^{2} \tan \left (x \right )}{a^{3}}-\frac {b \left (a^{2}+b^{2}\right ) \ln \left (a \tan \left (x \right )+b \right )}{a^{4}}\) | \(56\) |
risch | \(-\frac {2 \left (-3 i b^{2} {\mathrm e}^{4 i x}+3 a b \,{\mathrm e}^{4 i x}-6 i a^{2} {\mathrm e}^{2 i x}-6 i b^{2} {\mathrm e}^{2 i x}+3 a b \,{\mathrm e}^{2 i x}-2 i a^{2}-3 i b^{2}\right )}{3 a^{3} \left ({\mathrm e}^{2 i x}+1\right )^{3}}+\frac {b \ln \left ({\mathrm e}^{2 i x}+1\right )}{a^{2}}+\frac {b^{3} \ln \left ({\mathrm e}^{2 i x}+1\right )}{a^{4}}-\frac {b \ln \left ({\mathrm e}^{2 i x}+\frac {i b -a}{i b +a}\right )}{a^{2}}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i x}+\frac {i b -a}{i b +a}\right )}{a^{4}}\) | \(170\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 56, normalized size = 0.77 \begin {gather*} \frac {2 \, a^{2} \tan \left (x\right )^{3} - 3 \, a b \tan \left (x\right )^{2} + 6 \, {\left (a^{2} + b^{2}\right )} \tan \left (x\right )}{6 \, a^{3}} - \frac {{\left (a^{2} b + b^{3}\right )} \log \left (a \tan \left (x\right ) + b\right )}{a^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.46, size = 106, normalized size = 1.45 \begin {gather*} -\frac {3 \, {\left (a^{2} b + b^{3}\right )} \cos \left (x\right )^{3} \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}\right ) - 3 \, {\left (a^{2} b + b^{3}\right )} \cos \left (x\right )^{3} \log \left (\cos \left (x\right )^{2}\right ) + 3 \, a^{2} b \cos \left (x\right ) - 2 \, {\left (a^{3} + {\left (2 \, a^{3} + 3 \, a b^{2}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{6 \, a^{4} \cos \left (x\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{4}{\left (x \right )}}{a + b \cot {\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.41, size = 60, normalized size = 0.82 \begin {gather*} \frac {2 \, a^{2} \tan \left (x\right )^{3} - 3 \, a b \tan \left (x\right )^{2} + 6 \, a^{2} \tan \left (x\right ) + 6 \, b^{2} \tan \left (x\right )}{6 \, a^{3}} - \frac {{\left (a^{2} b + b^{3}\right )} \log \left ({\left | a \tan \left (x\right ) + b \right |}\right )}{a^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.22, size = 55, normalized size = 0.75 \begin {gather*} \mathrm {tan}\left (x\right )\,\left (\frac {1}{a}+\frac {b^2}{a^3}\right )+\frac {{\mathrm {tan}\left (x\right )}^3}{3\,a}-\frac {\ln \left (b+a\,\mathrm {tan}\left (x\right )\right )\,\left (a^2\,b+b^3\right )}{a^4}-\frac {b\,{\mathrm {tan}\left (x\right )}^2}{2\,a^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________